#include "../Base/stdafx.h"
#include "../Base/DXDevice.h"
#include "EffectLib.h"
#include "EffectShadow.h"
#include "../Base/DirectInput.h"


EffectShadow::EffectShadow(const tstring& file)
{
	m_Effect = EFFECTLIB->CreateEffect(file);
	
 	m_ShadowTech = m_Effect->GetTechniqueByName("BuildShadowMap");
	
	m_WVP = m_Effect->GetVariableByName("gLightWVP")->AsMatrix();
}

EffectShadow::~EffectShadow()
{

}

void EffectShadow::SetMatrixen(const D3DXMATRIX& world, const D3DXMATRIX& view, const D3DXMATRIX& proj)
{
	m_WVP->SetMatrix((float*)&(world * view * proj));
}

ID3D10EffectTechnique* EffectShadow::GetTech() const
{
	return m_ShadowTech;
}